package com.cskaoyan.market.constrain;

import com.cskaoyan.market.validator.LegalOrderValidator;
import com.cskaoyan.market.validator.LegalSortValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target(value = {PARAMETER})
@Retention(RUNTIME)
@Constraint(validatedBy = {LegalSortValidator.class})
@Documented
public @interface LegalSort {
    String message() default "sort不符合规范";

    // 分组
    Class<?>[] groups() default {};

    // 负载
    Class<? extends Payload>[] payload() default {};

    String[] value();
}
